package cn.tedu.io;

import java.io.File;
import java.util.Scanner;

public class T2_DiGUIShanchu {
    public static void main(String[] args) {
        String strpath = new Scanner(System.in).nextLine();
        File file = new File(strpath);
        totaldelete(file);
        System.out.println("文件已删除");
    }
    public static void totaldelete(File file){
        File []fs = file.listFiles();
        for (int i = 0; i <fs.length ; i++) {
            if(fs[i].isFile()){
                fs[i].delete();
            }else if(fs[i].isDirectory()){
                totaldelete(fs[i]);
            }
        }
        file.delete();//删除空的文件夹
    }
}
